<template>
  <div class="dashboard-container">
    <h2>当前登录</h2>
    <div class="dashboard-text">用户名： {{ name }}</div>
    <br>
    <div class="dashboard-text">角色： <span v-for="role in roles" :key="role">{{ role }}</span></div>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'

  export default {
    name: 'Dashboard',
    computed: {
      ...mapGetters([
        'name',
        'roles'
      ])
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 20px;
    }

    &-text {
      font-size: 20px;
      line-height: 26px;
    }
  }
</style>
